package top.laoshuzi.designpatterns.base.behavior.observer;

import org.junit.Test;

public class Client {

    @Test
    public void operation() {

        ConcreteSubject subject = new ConcreteSubject();
        Observer observer1 = new ConcreteObserver1();
        Observer observer2 = new ConcreteObserver2();

        subject.attach(observer1);
        subject.attach(observer2);

        subject.notifyAllObservers("state1");
        subject.notifyAllObservers("state2");
        subject.notifyAllObservers("state3");

    }
}
